#!/usr/bin/env python3 
from genericpath import isfile
import sys
import os
import shutil

if __name__ == '__main__':
    if (len(sys.argv)) == 1:
        print("not found params!")
    env = "pinyin"
    idx = 0
    for i in sys.argv:
        if (i.count("env:")):
            env = sys.argv[idx].split("env:")[1]
        idx += 1
    print(sys.argv, "-->>sys.argv-----")
    # # copy release.yaml
    # cur_p = os.getcwd()
    # tar_f = os.path.join(cur_p, "../../proj/pinyin/Assets/Resources/release.yaml")
    # from_f = os.path.join(cur_p, "env/{}/release.yaml".format(env))
    # is_tar = os.path.isfile(tar_f)
    # is_from = os.path.isfile(from_f)

    # print("from file path :{}, isfile:{}".format(from_f, is_from))
    # print("tar file path :{}, isfile:{}".format(tar_f, is_from))
    # if (is_tar) and (is_from):
    #     ret = shutil.copyfile(from_f, tar_f)
    #     print('copy suc!')
    #     sys.exit(0)
    # print("copy failed!")
    